A microcontroller includes a central processing unit CPU, which is the core of the microcontroller; a ROM, EPROM, EEPROM or Flash-EPROM-type central memory, which stores a program, referred to as the user program, that is loaded by the user prior to implantation of the microcontroller in the application; and an oscillator, which provides the main clock function of the microcontroller. The oscillator is provided to generate a clock signal, of which the frequency is typically approximately a dozen megahertz, which is used to activate the internal circuits of the microcontroller, in particular the CPU, in run mode.
The microcontroller also generally includes a circuit with an auxiliary oscillator, which performs the function of backup oscillator in run mode. The function of such a circuit is thus to provide the CPU with a low frequency signal output by the backup oscillator, when the clock signal output by the main oscillator is absent or has a frequency below a predetermined threshold.
The microcontroller generally contains other internal peripheral circuits which do not, however, need to be described in greater detail in the context of the present description.
A reset sequence switches the microcontroller from a start operation mode to run mode, in which the program loaded by the user in the microcontroller memory is run. Between these two modes, that is, during the reset sequence, the microcontroller is in reset mode.
When the reset sequence is initiated by switching on the microcontroller, the start mode is a power-off mode. All of the internal circuits of the microcontroller, except those dedicated to the management of the reset sequence, are inhibited, so that they do not operate. The microcontroller switches into run mode only when the main oscillator clock frequency is stabilized.
The reset sequence can also be initiated by an external reset signal or by a reset signal from a “watchdog” circuit. The start operation mode is then the run mode.
A stop mode can also be used, in which all of the internal activities of the CPU are stopped.
In most microcontrollers using a quartz-type external resonator for the clock system, the oscillator stabilization phase for providing the clock signal causes a time loss at the start-up. Moreover, if a phase locked loop (PLL) is used to multiply the clock frequency, it is also necessary to take into account the stabilization time of the loop before the PLL can be used as a clock system and before starting the application. Furthermore, these constraints prevent a rapid start-up of the microcontroller after a reset sequence has been initiated or after a stop mode.
In addition, the configuration of the microcontroller operation, for example, the choice of a clock source from those available on the microcontroller in order to take into account requirements of the application, is either materially fixed, which leaves the user with little flexibility, or requires a step of reading an option word which is stored in the memory of the microcontroller. Such a step is applied when the microcontroller is in run mode.